<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/taglibs/iss" prefix="iss"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>角色管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="../css/IDEA.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript src="../js/IDEA_body.js"
	type=text/javascript></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" type=text/javascript>      
     function delRoleInfo()
     {  
      	var flag =  document.getElementsByName("checkbox2");
      	var str='';
      	var decide = false;   
      	     
         for(var i=0;i<flag.length;i++)
         {                
             if(flag[i].checked)
             {
                str += flag[i].value+';';
                
                decide = true;               
             }
         }
         
         if(!decide)
         {
            alert("请选择要删除的角色！");           
         }
         else
         {
            str = str.substr(0,str.length-1);
         
           if(null != str && '' != str && "undefined" != str)
           {
              if(confirm('删除该角色信息，对应的资源关系也会删除，请您确认?'))
              {
                 myform.action='<%=request.getContextPath()%>/role/delRoleInfo.html?roleId='+str;
                 myform.submit();       
              }
           }
        }
     }
     
     function allCheckBox(obj)
     {
        var flag =  document.getElementsByName("checkbox2");               
        if(obj.checked == true)
        {
          for(var i = 0; i < flag.length; i++)
          {
             flag[i].checked = true;
          }
        }
        else
        {
            for(var i = 0; i < flag.length; i++)
          {
             flag[i].checked = false;
          }
        }
     }
     
     function cancelMyBox()
     {
        var box =  document.getElementsByName("checkbox2");
        var mybox =  document.getElementsByName("mybox");        
        var flag = true;
        
        for(var i = 0; i < box.length; i++)
        {
            if(!box[i].checked)
            {
               flag = false;
            }
        }
        if(flag)
        {
           mybox[0].checked=true;
        }
        else
        {
           mybox[0].checked=false;
        }
     }
</SCRIPT>
<META content="MSHTML 6.00.2900.3243" name=GENERATOR>
</HEAD>
<BODY>
<TABLE width="100%" height="100%" border=0 cellPadding=0 cellSpacing=0>
	<TBODY>
		<TR>
			<TD bgcolor="#FFFFFF" class=right_bg>
			<table width="100%" height="5" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			<table width="100%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td width="20">&nbsp;</td>
					<td class="text_12_title">当前位置: <a href="#" class="blue_1">首页</a>
					&gt; <a href="#" class="blue_1">角色管理</a>&gt; 查询角色信息</td>
				</tr>
			</table>
			<table width="100%" height="10" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			<table width="98%" border="0" cellpadding="0" cellspacing="0"
				background="../images/bg_body_title.jpg" class="list_border1">
				<tr>
					<td width="10">&nbsp;</td>
					<td>
					<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td></td>
							<td valign="bottom" class="text_12_border">查询角色信息</td>
							<td></td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
			<table width="98%" border="0" cellpadding="0" cellspacing="0"
				class="list_border2">
				<tr>
					<td align="center" valign="top">
					<table width="98%" height="20" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td></td>
						</tr>
					</table>
					<table width="98%" border="0" cellspacing="0" cellpadding="0">
						<form name="myform" method="POST"
							action="../role/queryRoleInfos.html">
						<tr>
						<td>
						业务系统：&nbsp;
						<select name="systemId">
						<option value="">请选择</option>
						<c:forEach var="systemBean" items="${systemBeanList}">
						<option value="${systemBean.systemId}"
						<c:if test="${systemId eq systemBean.systemId}">selected</c:if>
						>${systemBean.systemName}</option>
						</c:forEach>
						</select>&nbsp;
						角色名称：&nbsp;
						<input type="text" name="roleName"
								id="roleName">&nbsp;
							<input name="Submit" type="submit" class="button_normal"
								value="查  询"></td>			</tr>
						</form>
					</table>

					<table width="98%" height="10" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td></td>
						</tr>
					</table>
					<TABLE width="98%" border=0 cellPadding=0 cellSpacing=0
						class=list_border>
						<TBODY>
							<TR>
								<TD class=list_title width="2"><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD width=10% class=list_title><input type="checkbox"
									name="mybox" onclick="allCheckBox(mybox);"></TD>
								<TD class=list_title width="2"><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD width="20%" class=list_title>角色名称</TD>
								<TD width="1" class=list_title><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD width="20%" class=list_title>子系统名称</TD>
								<TD width="2" class=list_title><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD width="20%" class=list_title>角色描述</TD>
								<TD width="2" class=list_title><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD width="20%" class=list_title>操作</TD>
							</TR>
							<c:forEach var="bean" items="${roleBean}" varStatus="status">
								<c:choose>
									<c:when test="${status.index%2==0}">
										<TR class=list_td_white1>
									</c:when>
									<c:when test="${status.index%2==1}">
										<TR class=list_td_white0>
									</c:when>
								</c:choose>
								<TD></TD>
								<TD align="center"><input type="checkbox" name="checkbox2"
									value="${bean.roleId}" onclick="cancelMyBox();"></TD>
								<TD></TD>
								<TD align="center">${bean.roleName}</TD>
								<TD></TD>
								<TD align="center">${bean.systemName}</TD>
								<TD></TD>
								<TD align="center">${bean.roleDesc}</TD>
								<TD></TD>
								<TD align="center"><a
									href='<%=request.getContextPath()%>/role/updateRoleInfo.html?roleId=${bean.roleId}'>修改
								|</a> <a
									href='<%=request.getContextPath()%>/role/queryResourceInfo.html?roleId=${bean.roleId}'>查看资源</a></TD>
								<TD></TD>
								</TR>

							</c:forEach>
						</TBODY>
					</TABLE>
					<table width="98%" height="24" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td align="right"><iss:navigation /></td>
						</tr>
					</table>
					<table width="98%" height="28" border="0" cellpadding="0"
						cellspacing="0">
						<tr>

							<td valign="top"><input name="Submit22" type="submit"
								class="button_normal" value="新 增"
								onClick="window.location.href='<%=request.getContextPath()%>/role/insertRoleInfo.html'">
							&nbsp;&nbsp; <input name="Submit32" type="button"
								class="button_normal" value="删除" onClick="delRoleInfo();"></td>
						</tr>
					</table>
			</table>
			<table width="98%" height="5" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			</TD>
		</TR>
	</TBODY>
</TABLE>
</BODY>
</HTML>
